package day3;

import org.junit.Test;

public class Method {
	@Test
	public void test1() {
//		System.out.println("Hello");
//		System.out.println("Hello");
//		System.out.println("Hello");
		
		print();// 方法的调用：方法名+参数
	}
	public void print() {
		System.out.println("Hello");
		System.out.println("Hello");
		System.out.println("Hello");
	}
	
	@Test
	public void test2() {
		int num1 = 3;
		int num2 = 5;
		int max = getMax(num1, num2);// 运行顺序24-38-45-24
//		int max;
//		if (num1 > num2) {
//			max = num1;
//		} else {
//			max = num2;
//		}
		System.out.println(max);
		int num3 = 34;
		int num4 = 45;
		int max2 = getMax(num3, num4);// 运行顺序34-38-45-34
		System.out.println(max2);
	}
	
	public int getMax(int num1, int num2) {
		int max;
		if (num1 > num2) {
			max = num1;
		} else {
		max = num2;
		}
		return max;
	}
}
